menu model: set separator label conditionally
authorRyan Lortie <desrt@desrt.ca>
Mon, 24 Jun 2013 21:59:52 +0000 (17:59 -0400)
committerRyan Lortie <desrt@desrt.ca>
Mon, 24 Jun 2013 22:05:27 +0000 (18:05 -0400)
commitc79a21e1ddda961be43813daa9179505af89adb7
treea95e388fe7c785b7397aaaaa48bb385e6cdf2d0e
parentd498e9b588fd59aabc82eea8e87962435b0fe191
menu model: set separator label conditionally

When creating separators we were binding the "label" property on the
tracker to the "label" property on the GtkSeparatorMenuItem.

This was problematic for two reasons.

First, it was pointless.  The section header label will never change.

Second, it was causing problems: doing the binding caused the value to
be initially synced up, even if it was NULL.  Doing this caused
GtkMenuItem to create a GtkAccelLabel and add it as a child, which
prevented the separator from being shown normally.

Change the code a bit so that we just call gtk_menu_item_set_label()
when creating the item, if we find the label to be non-NULL.

Also, show() the separator item at first.  GtkMenu manages visibility of
separators internally, but it seems "more correct" to show it ourselves
at first.
gtk/gtkmenushell.c